--- Shows that we can use exotic characters everywhere.
--- हम भारतीय पर टिप्पणी कर सकते हैं.
--- Але краще нехай це залишиться.
module tests.comp.Issue58 where


--- 𝔉𝔯𝔢𝔤𝔢 𝔰𝔢𝔩𝔟𝔰𝔱 𝔥𝔞𝔱 𝔡𝔦𝔢𝔰𝔢 𝔖𝔠𝔥𝔯𝔦𝔣𝔱 𝔟𝔢𝔫𝔲𝔱𝔷𝔱.
𝔣𝔯𝔢𝔤𝔢 = true

type 𝕀 = Integer

infix 6 `⩽`

𝒿𝓊𝓈𝓉  = Just

--- We still can't use non spacing marks like ॖॖॖॗ
बह = "ja"

--- We can't do this in latin either: @ä@ is ok, but @å@ is not
--- This is "a\u030a", i.e. 'a' followed by "U+030A COMBINING RING ABOVE"
--- >  å = 17
--- We could allow non spacing marks in identifiers, though.
                
(⩽) :: 𝕀 -> 𝕀 -> Maybe Bool
1 ⩽ 2 = 𝒿𝓊𝓈𝓉  𝔣𝔯𝔢𝔤𝔢
𝕡 ⩽ 𝕢 = 𝓷𝓸𝓽𝓱𝓲𝓷𝓰 where 𝓷𝓸𝓽𝓱𝓲𝓷𝓰 = Nothing

--- Devanagari letters seem to be neither lowercase nor uppercase.
main _ = do
    let codepoint = devanagari.charAt 0
    out codepoint "lowercase" Char.isLowerCase
    out codepoint "uppercase" Char.isUpperCase
    out codepoint "letter"    Char.isLetter
  where
    devanagari = "ज𝔩"
    out :: Char -> String -> (Char -> Bool) -> IO ()
    out cp s f = println ("The devanagari letter " ++ devanagari  ++ " is " ++ s ++ ": " ++ show (f cp))